#include <stdio.h>
#include <time.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"


void HwDelayUs(uint32_t us)
{
    uint32_t start, curr;
    __asm__ __volatile__("rsr %0, ccount" : "=r"(start));
    do {
        __asm__ __volatile__("rsr %0, ccount" : "=r"(curr));
    } while ((curr - start) < us);
}


